package com.authsphere.common.utils;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/26 11:00
 **/
public class DateUtils {

    /**
     * 将LocalDateTime转换为时间戳
     * @param localDateTime
     * @return
     */
    public static long convertToMillis(LocalDateTime localDateTime) {
        if (localDateTime == null) {
            return 0L;
        }
        return localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
    }
}
